<template>
    <div>
        <list-table ref="listTable" @showDialog="showDialog" v-bind="$attrs"></list-table>
        <detail-document-dialog :visible.sync="detailVisible" v-if="detailVisible" :row="currRow" @reloadList="query" :path="myPath"></detail-document-dialog>
    </div>
</template>
<script>
    import schoolSignature from "@/api/officialDocument/schoolSignature/index";
    import ListTable from "./ListTable";
    import MyWord from "@/components/WorkFlowsDialog/DocumentCase/MyWord";
    import NotesListButton from "../../../components/WorkFlowsDialog/DocumentCase/NotesListButton";
    import DetailDocumentDialog from "@/components/WorkFlowsDialog/DetailDocumentDialog";
    import mixincommon from '@/mixins/common'
    export default {
        name: "TabContent",
        components: {DetailDocumentDialog, NotesListButton, MyWord,ListTable},
        mixins:[mixincommon],
        data() {
            return {
                detailVisible: false,
                currRow: {},
                showActiveBtn: false,
            }
        },
        created() {
        },
        computed: {
          myPath(){
            return this.fullPath.replace("allS","s")
          }
        },
        methods: {
            query() {
                this.$refs["listTable"].query();
            },
            showDialog(row, type) {
                schoolSignature.getDocumentById(row.id).then(res => {
                    this.currRow = res.data
                    if (type == "handle") {
                        this.showActiveBtn = true
                        this.detailVisible = true
                    } else if (type == 'view') {
                        this.showActiveBtn = false
                        this.detailVisible = true
                    }
                })

            },
        }
    }
</script>
